<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Vue案例-计数器</title>
</head>
<body>
<div id="app">
    <button v-on:click="add">点我增加</button>
    <button v-on:click="sub">点我减少</button><br>当前计数:{{num}}
</div>
<script src="../js/vue.js"></script>
<script>
    const vm = new Vue({
        el:"#app",
        data:{
            num:0
        },
        methods:{
            add(){
                this.num++;
            },
            sub(){
               this.num--;
            }

        }
    });
</script>

</body>
</html>